package xyz.weizhi.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import xyz.weizhi.tanhua.dubbo.mapper.SettingsMapper;
import xyz.weizhi.tanhua.model.domain.Settings;

/**
 * @Author milian
 * @Date 2021/10/24 0024 16:20
 */
@DubboService
public class SettingsApiImpl extends ServiceImpl<SettingsMapper,Settings> implements SettingsApi{
    @Autowired
    private SettingsMapper settingsMapper;
    @Override
    public Settings findByUserId(Long userId) {
        QueryWrapper<Settings> qw = new QueryWrapper<>();
        qw.eq("user_id", userId);
        return settingsMapper.selectOne(qw);
    }
}
